module TitleCase (titleCase) where
import Data.Char (toUpper, toLower)
titleCase :: String -> String -> String
titleCase _ [] = []
titleCase minor title = unwords $ tc (head ws) : (f <$> tail ws)
  where tc (c:cs) = toUpper c : cs
        ws = words $ toLower <$> title
        ms = words $ toLower <$> minor
        f w = if elem w ms then w else tc w

